<?phpnamespace app\common\model;use think\Db;use think\Exception;use think\Model;class TestNutrition extends Model{    public static function treeList($menu){        $list = [];        foreach ($menu as $row){            if($row['parent_id'] == 1 ){                $row['children'] = [];                $list[$row['id']] = $row;            }else{                $list[$row['parent_id']]['children'][] = $row;            }        }        return $list;    }}